#import <Foundation/Foundation.h>
#import "Server.h"
#import "Client.h"

int main (int argc, const char * argv[]) {
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
	
	int getter;
	NSString *serverName;
	char name[256];  
	
    printf ("Bitte wählen:\n");
	printf ("1. Server\n");
	printf ("2. Client\n");
	
	scanf("%d", &getter);
	
	if (getter == 1) {
		Server *s = [[Server alloc] autorelease];
		[s startServer];
	} else {
		printf("Bitte Server eingeben:\n");
		scanf("%s", &name);
		serverName = [NSString stringWithCString: name encoding: NSASCIIStringEncoding]; 
		
		Client *c = [[Client alloc] autorelease];
		[c startClient:serverName];
	}
	
	
    [pool drain];
    return 0;
}
